﻿using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using RevitInteractiveUtility;

namespace YJKRevitCode.SampleAndTest
{
	[Transaction(TransactionMode.Manual)]
	public class TestCmdCurrentDoc : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			UIDocument activeUIDocument = commandData.Application.ActiveUIDocument;
			Document document = activeUIDocument.Document;
			Selection selection = activeUIDocument.Selection;
			Element element = document.GetElement(selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element));
			DoubleCilckToLocate.DoubleClickToLocate(activeUIDocument, document.ActiveView, element, document, true);
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
